package top.liuzhenyu.springboot3.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import top.liuzhenyu.springboot3.base.PageBean;
import top.liuzhenyu.springboot3.base.R;
import top.liuzhenyu.springboot3.entity.TbGamePublisher;
import top.liuzhenyu.springboot3.service.TbGamePublisherService;
import top.liuzhenyu.springboot3.vo.PageVO;

import java.util.List;

@RestController
@RequestMapping("/gamepublisher")
@RequiredArgsConstructor
public class TbGamePublisherController {
    private final TbGamePublisherService tbGamePublisherService;

    @PostMapping("")
    public R<String> insert(@RequestBody TbGamePublisher tbGamePublisher) {
        return tbGamePublisherService.insert(tbGamePublisher);
    }

    @GetMapping("")
    public R<List<TbGamePublisher>> query(TbGamePublisher tbGamePublisher)
        {return tbGamePublisherService.query(tbGamePublisher);
    }

    @GetMapping("/{id}")
    public R<TbGamePublisher> queryById(@PathVariable("id") Integer id) {
        return tbGamePublisherService.queryById(id);
    }

    @PutMapping("")
    public R<String> update(@RequestBody TbGamePublisher tbGamePublisher) {
        return tbGamePublisherService.update(tbGamePublisher);
    }

    @DeleteMapping("/{id}")
    public R<String> delete(@PathVariable("id") Integer id) {
        return tbGamePublisherService.delete(id);
    }


}
